<!-- 首页项目介绍 -->
<template>
  <div class="box">
    <div class="container">
      <div class="left">
        <span>一款开源的、免费的简历设计神器</span>
        <span>快速设计、简历主题切换,支持一键导出PDF、JSON数据等。</span>
        <div class="left_item">
          <el-button
            @click="gotoMake"
            type="primary"
            round
            :icon="Pointer"
            color="#7C85D0"
          >
            在线制作
          </el-button>
          <el-button
            @click="gotoFreeMedel"
            class="center"
            type="primary"
            round
            :icon="Plus"
            color="#7C85D0"
          >
            简历制作攻略
          </el-button>
          <el-button type="primary" round :icon="Headset" color="#7C85D0">
            <a href="https://gitee.com/lilizeman/simplification" class="origin_code">获取源码</a>
          </el-button>
        </div>
      </div>
      <div class="right">
        <img src="@/assets/images/index.png" alt="" />
      </div>
    </div>
  </div>
</template>
<script setup lang="ts">
import { Pointer, Plus, Headset } from '@element-plus/icons-vue'
import { useRouter } from 'vue-router'
const router = useRouter()
const emits = defineEmits(['gotoMake', 'gotoFree'])
function gotoMake() {
  emits('clickProIndroduce')
}
function gotoFreeMedel() {
  //自动跳转到自定义模块
  // emits('gotoFree')
  //跳转到简历攻略页面
     router.push({ name: 'create' })
}
//第一种方法：
//页面可见区域高度-减去导航条的高度
// const scrollHeight = ref(document.documentElement.clientHeight-60)
// function gotoMake() {
//   //window.scrollTo(x，y)x轴，y轴 滚动距离
//      window.scrollTo(0,scrollHeight.value)
// }
//第二种：通过自定义事件触发
</script>

<style lang="scss" scoped>
@mixin size($w, $h) {
  width: $w;
  height: $h;
}
.box {
  @include size(100%, 100vh);
  background: linear-gradient(to right, #ec6ead, #3494e6);
  .container {
    padding: 0 100px;
    padding-top: 300px;
    display: flex;
    justify-content: space-evenly;

    .left {
      color: aliceblue;
      width: 50%;
      display: flex;
      flex-direction: column;
      .center {
        margin: 4px 4px;
      }
    }

    .left span:first-child {
      font-size: 28px;
    }
    .left span:nth-child(2) {
      font-size: 12px;
      opacity: 0.8;
      padding: 20px 0;
    }
    .right {
      width: 50%;
      margin-top: -20px;
      img {
        width: 40vw;
      }
    }
  }
  .origin_code {
    color: black;
    text-decoration: none;
  }
}
</style>
